<template>

    <table>
                <tr>
                    <th>职员姓名</th>
                    <th>
                            <input type="text" v-model="tainaji1.zname">

                    </th>
                </tr>
                <tr>
                    <th>职员手机号</th>
                    <th>
                            <input type="text"  v-model="tainaji1.phone">

                    </th>
                </tr>
                <tr>
                    <th>性别</th>
                    <th>
                           <input type="radio" :value="1" v-model="tainaji1.sex">男
                           <input type="radio" :value="0" v-model="tainaji1.sex">女

                    </th>
                </tr>
                <tr>
                    <th>家庭住址</th>
                    <th>
                            <input type="text" v-model="tainaji1.address">

                    </th>
                </tr>

                <tr>
                    <th>部门id</th>
                    <th>
                            <input type="text" v-model="tainaji1.bid">

                    </th>
                </tr>
                <tr>
                    <th>薪资</th>
                    <th>
                            <input type="text" v-model="tainaji1.price">

                    </th>
                </tr>
                <tr>
                    <th>绩效</th>
                    <th>
                            <input type="text" v-model="tainaji1.jiXiao">

                    </th>
                </tr>
               
                <tr>
                    <th></th>
                    <th>
                           <button @click="tainaji">修改</button>

                    </th>
                </tr>




    </table>


</template>


<script setup lang="ts">


import axios from 'axios';
import{ref}from'vue'
import { useRoute } from 'vue-router';

const route=useRoute()
const tainaji1 =ref({

"zid": route.params.id,
"zname": "string",
"phone": "string",
"sex": 0,
"address": "string",
"bid": 0,
"price": 0,
"jiXiao": 0,
"isDel": true,
"dewltime": "2024-12-25T12:52:17.599Z",
"addtime": "2024-12-25T12:52:17.599Z"


})


const tainaji =()=>{


axios.put('https://localhost:7288/api/ZhiYuan/UpdataZy',tainaji1.value).then(res=>{

    if(res.data>0)
{
    alert('修改成功')
}
else
{
    alert('修改失败')
}
})

}




</script>